tests: Make failing to kill the GPG agent non-fatal
authorColin Walters <walters@verbum.org>
Thu, 31 Mar 2016 17:46:16 +0000 (13:46 -0400)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Thu, 31 Mar 2016 18:43:31 +0000 (18:43 +0000)
It's not working for me in `make check` on a RHEL 7 Workstation,
apparently because no GPG agent is spawned.  I'm guessing this has
something to do with the GPG version?

The downside of this is we will be less likely to notice if GPG
changes again and we start leaking agents like we're in The Matrix
Reloaded.  But the real solution to that is containers anyways.

Closes: #233
Approved by: smcv

tests/libtest.sh
tests/test-commit-sign.sh
tests/test-gpg-signed-commit.sh
tests/test-pull-mirror-summary.sh
tests/test-pull-summary-sigs.sh
tests/test-remote-gpg-import.sh

index 3e4c4bd6d4b4737906df2289a3c8127809fd75e5..03b498aa2956dfe87b5435b331fd9daf8b60e2a0 100755 (executable)
@@ -349,3 +349,7 @@ skip_without_fuse () {
         exit 0
     fi
 }
+
+libtest_cleanup_gpg () {
+    gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye || true
+}
index 1b153e9a542a9db7648ed2e00207e04a016aa684..e469c0f95e386d4954c1c2e04982906070469a0f 100755 (executable)
@@ -132,6 +132,6 @@ if ${CMD_PREFIX} ostree --repo=repo show main | grep -o 'Found [[:digit:]] signa
 fi
 
 rm -rf repo gnomerepo-files
-gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye
+libtest_cleanup_gpg
 
 echo "ok"
index 096c0e1c55f3e7ec042681f490618fe5d424bece..fa42d677ed58bac260e5576f343dad0cbbd24988 100755 (executable)
@@ -78,6 +78,6 @@ if ${OSTREE} show test2 | grep -o 'Found [[:digit:]] signature'; then
   assert_not_reached
 fi
 
-gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye
+libtest_cleanup_gpg
 
 echo "ok"
index d5e27fc8f86ddd7ba1b79f983383fda7e2d3deaf..49aa91ad2bc209c3fe775022a0d9889c332c393e 100755 (executable)
@@ -122,4 +122,4 @@ echo "ok pull mirror with invalid summary sig and no verification"
 
 # echo "ok pull mirror with signed summary covering static deltas"
 
-gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye
+libtest_cleanup_gpg
index dd2fcb0f6c38c729b03e3ab8a0974e125a48cf78..40de0a666db69c50da1e33e4aa885a04f46352c0 100755 (executable)
@@ -134,4 +134,4 @@ grep static-deltas summary.txt > static-deltas.txt
 assert_file_has_content static-deltas.txt \
   $(${OSTREE} --repo=repo rev-parse origin:main)
 
-gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye
+libtest_cleanup_gpg
index aa90eb891614a066bac22eb5d72b040435feca25..8d155f7972040b7b0f08bdda7a5acebb97396b5c 100755 (executable)
@@ -143,5 +143,5 @@ if ${OSTREE} pull R2:main >/dev/null 2>&1; then
 fi
 ${OSTREE} pull R3:main >/dev/null
 
-gpg-connect-agent --homedir ${test_tmpdir}/gpghome killagent /bye
+libtest_cleanup_gpg
 echo "ok"